
() => "Simple Function";

// () 代表函数参数，没有名字的函数称为匿名函数
// => 是函数体 /定义的开始
// => 后面的内容是函数体/定义

let simpleFN=() =>"this is a Simple Function"
console.log(simpleFN());

let FN = () =>{
    const b=2;

    if(true){
        let a=1;
        console.log(a);
        console.log(b);
    }
    console.log(b);
};

FN();


let identifier=(value) =>value;
console.log(identifier(5));



let tellType=(arg) =>{
    if(typeof arg === "function"){
        arg();
    }
    else {
        console.log("The passed data is "+arg);
    }
};


let data=1
tellType(data)

let dataFN = () =>{
    console.log("I'm a function");
}

tellType(dataFN());


let funcs=[];
for(let i=0;i<10;i++){
    funcs.push(function () {
        console.log(i);
    })
};

funcs.forEach(function (func) {
    func();
})

